/*
 * @Author: 别拿暗恋当饭吃. 13466071+lililkli@user.noreply.gitee.com
 * @Date: 2024-07-10 19:28:24
 * @LastEditors: 别拿暗恋当饭吃. 13466071+lililkli@user.noreply.gitee.com
 * @LastEditTime: 2024-07-10 19:40:30
 * @FilePath: \新建文件夹\doctor\src\store\Consultationinformation\Historicalconsultation\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import {createAsyncThunk,createSlice} from '@reduxjs/toolkit'
import * as services from 'services/Consultationinformation/historicalconsultation'
import { addBuilder } from 'store/dict'

export const dohistoricalconsultation = createAsyncThunk<any,any>(
    'historicalconsultation/dohistoricalconsultation',
    async(data)=>{
        const res = await services.Historicalconsultation(data.page,data.count)

        return res
    }
)

const initialState = {
    historicalconsultation:{}
}

const Historicalconsultation = createSlice({
    name:'historicalconsultation',
    initialState,
    reducers:{},
    extraReducers:(builder)=>{
        addBuilder(builder,dohistoricalconsultation,(state,action)=>{
            console.log(action);
            const {result} = action.payload
            state.historicalconsultation = result
        })
    }
})

export default Historicalconsultation.reducer

export const HistoricalconsultationSelecer = (state:any) =>{
    return state.historicalconsultation.historicalconsultation
}